package com.cn.web.controller.EM.partRegt;

import com.alibaba.fastjson2.JSONObject;
import com.cn.bean.vo.EM.partRegt.BarkPar;
import com.cn.mapper.dao.db5.EM.partRegt.BaseRackAlterDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;

@CrossOrigin
@RestController
@Transactional
@RequestMapping("/BaseRackAlter")
public class BaseRackAlterController {
    private final BaseRackAlterDao baseRackAlterDao;

    @Autowired(required = false)
    public BaseRackAlterController(BaseRackAlterDao baseRackAlterDao) {
        this.baseRackAlterDao = baseRackAlterDao;
    }


    @RequestMapping("/insert")
    @ResponseBody
    public BarkPar insert(@RequestBody JSONObject jsonObject) {
        System.out.println("jsonObject:aaaaaaaaaaaaaaa" + jsonObject);


        return baseRackAlterDao.insert(String.valueOf(jsonObject));

    }

    @RequestMapping("/getSing")
    @ResponseBody
    public String getSing(@RequestBody JSONObject jsonObject) {
        System.out.println("jsonObject:aaaaaaaaaaaaaaa" + jsonObject);
        return baseRackAlterDao.getSing(String.valueOf(jsonObject));
    }

    @RequestMapping("/getList")
    @ResponseBody
    public String getList(@RequestBody JSONObject jsonObject) {
        System.out.println("jsonObject:aaaaaaaaaaaaaaa" + jsonObject);
        String list = baseRackAlterDao.getList(String.valueOf(jsonObject));
        System.out.println("xxxxxxxxxxxxxx:" + list);
        return list;
    }

    @RequestMapping("/getRack")
    @ResponseBody
    public String getRack(@RequestBody JSONObject jsonObject) {
        System.out.println("jsonObject:eeeeeeee" + jsonObject);
        String list = baseRackAlterDao.getRack(String.valueOf(jsonObject));
        System.out.println("xxxxxxxxaaxxxxxx:" + list);
        return list;
    }

    @RequestMapping("/getInfo")
    @ResponseBody
    public String getInfo(@RequestBody JSONObject jsonObject) {
        System.out.println("jsonObject:ccccccccccc" + jsonObject);
        String list = baseRackAlterDao.getInfo(String.valueOf(jsonObject));
        System.out.println("assxxxxxxxxxx:" + list);
        return list;
    }

    @RequestMapping("/stateUp")
    @ResponseBody
    public BarkPar stateUp(@RequestBody JSONObject jsonObject) {
        System.out.println("jsonObject:ccccccccccc" + jsonObject);
        return baseRackAlterDao.stateUp(String.valueOf(jsonObject));
    }


}
